package com.lanou3g.ptp.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@ApiModel(description = "预警信息")
public class Warning implements Serializable {

    @ApiModelProperty(name = "预警信息ID", hidden = true)
    private Long id;

    @ApiModelProperty(name = "任务ID")
    private Long taskId;

    @ApiModelProperty(name = "学生ID")
    private Long studentId;

    @ApiModelProperty("预警方案类型（0签到预警，1日志预警）")
    private Integer type;

    @ApiModelProperty("预警信息内容")
    private String content;

    @ApiModelProperty(name = "状态", hidden = true)
    private int status;

    @ApiModelProperty(name = "创建时间", hidden = true)
    private Date createTime;

    @ApiModelProperty(name = "更新时间", hidden = true)
    private Date updateTime;

    public Warning(Long taskId, Integer type) {
        this.taskId = taskId;
        this.type = type;
        this.status = 0;
        Date now = new Date();
        this.createTime = now;
        this.updateTime = now;
    }

    public static final String CONTENT_SIGN_IN_A_ROW = "%s连续%s次未签到";
    public static final String CONTENT_SIGN_PER_WEEK = "%s本周%s次未签到";
    public static final String CONTENT_SIGN_IN_TOTAL = "%s总共%s次未签到";
    public static final String CONTENT_DIARY_IN_A_ROW = "%s连续%s次未提交日志";
    public static final String CONTENT_DIARY_PER_WEEK = "%s本周%s次未提交日志";
    public static final String CONTENT_DIARY_IN_TOTAL = "%s总共%s次未提交日志";
}
